<?php 
include("contact.html");
$your_name = $_POST['your_name'];
$your_address = $_POST['your_address'];
$your_nearest_landmark = $_POST['your_nearest_landmark'];
$your_phoneno = $_POST['your_phoneno'];
$your_building_type = $_POST['your_building_type'];
$your_job_type = $_POST['your_job_type'];
$your_any_other_questions = $_POST['your_any_other_questions'];

$your_email = $_POST['your_email'];
$prefix = "E";
$EnquiryID = $prefix + time();


$message = " Customer Enquiry Details : EnquiryID : $EnquiryID\n";
$messagetocustomer = $message;
$books = array("Name", "Address", "Nearest Landmark","Email","Phone no","BuildingType","Job Type","Query");
$pages = array($your_name, $your_address,$your_nearest_landmark,$your_email,$your_phoneno,$your_building_type,$your_job_type,$your_any_other_questions);
for ($i = 0; $i < count($books); $i++) {
    $message .= sprintf("%'.-20s%'.7s\n", $books[$i], $pages[$i]);
}

$messagetocustomer = "\r\n" . 
"Dear Mr/Ms " .  $your_name . ",\r\n" 
. " 
Thank you for your enquiry regarding our wide range of pest control services.
EnquiryID for future references is : " . $EnquiryID . "

Fair Care Pest Control Services
S.No. 281/3, Anand Nagar, Sathewasti, Opp Rajmudra Hotel, 
Dhanori - Lohegaon Road, Pune, 411 047, INDIA
Phone: +91-9561700410
www.faircarepestcontrol.com";

$subject = 'Enquiry From Customer';
$subjecttocustomer = 'Enquiry @ FairCare Pest Control Services';
$to = $your_email;

$from = 'sales@faircarepestcontrol.com';
$ownwer = 'mangesh@faircarepestcontrol.com';
//$to .= ',' . $ownwer ;


//$headers="From: {$from}\r\nReply-To: {$your_email}";
$headers="From: {$from}\r\n";
$headers .= "To: {$your_email}\r\n";
$headers .= "BCC: {$from}\r\n";
$smtp = mail($to,$subjecttocustomer,$messagetocustomer,$headers);
if ($smtp) {


	$to = $ownwer;
	$headers="From: {$from}\r\n";
	$headers .= "To: {$ownwer}\r\n";
	$headers .= "BCC: {$from}\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
	$message = '<html><body>';
	$message .= "<h2> Customer Enquiry Details : EnquiryID : " . $EnquiryID . "</h2>";
	//$message .= '<img src="http://css-tricks.com/examples/WebsiteChangeRequestForm/images/wcrf-header.png" alt="Website Change Request" />';
	$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
	$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . $your_name . "</td></tr>";
	$message .= "<tr><td><strong>Address:</strong> </td><td>" . $your_address . "</td></tr>";
	$message .= "<tr><td><strong>Nearest Landmark:</strong> </td><td>" . $your_nearest_landmark . "</td></tr>";
	$message .= "<tr><td><strong>Email:</strong> </td><td>" . $your_email . "</td></tr>";
	$message .= "<tr><td><strong>Phone no:</strong> </td><td>" . $your_phoneno . "</td></tr>";
	$message .= "<tr><td><strong>BuildingType:</strong> </td><td>" . $your_building_type . "</td></tr>";
	$message .= "<tr><td><strong>Job Type:</strong> </td><td>" . $your_job_type . "</td></tr>";
	$message .= "<tr><td><strong>Query:</strong> </td><td>" . $your_any_other_questions . "</td></tr>";
	$message .= "</table>";
	$message .= "</body></html>";
	
	$smtp = mail($to,$subject,$message,$headers);
}


$success = "Thank you! You're email has been sent.";

if ($smtp)
//echo $success;
contact.html;
else
echo 'nooo';

?>